package com.winhands.cshj.article.repository;


import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;

import com.winhands.base.service.MyBatisRepository;
import com.winhands.cshj.article.entity.Article;
import com.winhands.cshj.article.entity.SubjectMag;
import com.winhands.cshj.article.entity.SubjectResult;

/**
 * 日志数据库操作层 基于mybais
 * @author yuanl
 *
 */  
@Component
public interface MBArticleDao extends MyBatisRepository{
	
	public List<Article> queryNotifyArticleList(Map<String, Object> conditions);
	
	public List<Article>queryArticleList(Map<String,Object> conditions);
	public List<Article>queryArticleListWeb(Map<String,Object> conditions);
	public List<Article>queryArticleListByMemId(Map<String,Object> conditions);
	public void delArticleById(String id);
	public List<Article>queryCollectList(Map<String,Object> conditions);
	//收藏榜置顶
	public int updateOrderSc(Article article) throws Exception;
	public int updateOrderScqx(Article article) throws Exception;
	//最新，热门，精选置顶
	public int updateOrderArticle(Article article) throws Exception;
	//最新，热门，精选置顶  取消
	public int updateOrderArticleQx(Article article) throws Exception;
	public int updateArticleNotify(Article article) throws Exception;
	//获取文章相关的题库
	public List<SubjectMag>querySubjectMagByArticleId(String article_id);
	//新增题目
	int saveSubjectMag(SubjectMag subjectMag) throws Exception;
	//修改题目
	int updateSubjectMag(SubjectMag subjectMag) throws Exception;
	//根据题目id获取题目
	SubjectMag querySubjectById(String id) throws Exception;
	//保存学生答题结果
	int saveSubjectResult(SubjectResult subjectResult) throws Exception;
	//查询学生答题结果
	public List<SubjectResult>querySubjectResult(SubjectResult SubjectResult);
	//阅读排行榜列表
	public List<Article>queryReadList(Map<String,Object> conditions);
	//阅读排行榜置顶
	public int updateOrderRead(Article article) throws Exception;
	//阅读排行榜置顶  取消
	public int updateOrderReadqx(Article article) throws Exception;
	int deleteSubjectMagById(String subject_id) throws Exception;//根据文章id获取该文章阅读数，收藏数，点赞数
	public Article queryNumById(String id); 
}
